var express = require('express')
var router = express.Router()
const obj = require('../controllers/admin')

// 增加
router.post('/add', function (req, res, next) {
	obj.addData(req.body, res)
})
// 分页
router.get('/page', function (req, res, next) {
	obj.getPage(req.query, res)
})
// 列表
router.get('/list', function (req, res, next) {
	obj.getList(req.query, res)
})
// 详情
router.get('/info/:id', function (req, res, next) {
	obj.getInfo(req.params, res)
})
// 修改
router.post('/update', function (req, res, next) {
	obj.updateData(req.body, res)
})
// 删除
router.post('/delete', function (req, res, next) {
	obj.deleteData(req.body, res)
})
router.get('/getRouter', function (req, res, next) {
	obj.getRouter(req.body, res, req)
})

module.exports = router
